@extends('admin.container')

@section('c-head')
    <script type="text/javascript">
        var PAGE_DATA = {
            REST_API: {
                edit_account_url: "", // 编辑[账户]
                get_account_list_url: "{{route('admin.account.index')}}", // 获取 [账户]列表数据,搜索
            }
        };
    </script>
@stop

@section('c-body')
    <div class="comm-title">
                    <span class="title-msg">
                        账户管理
                    </span>
    </div>
    <div class="comm-body">
        <div class="tool-bar-top clearfix" style="padding-top:25px;">

            <div style="width:560px;float: left;">
                <div class="input-unit">
                                <span class="key-txt">
                                    公司全称:
                                </span>
                    <input class="val-input" id="company_name"/>
                </div>
                <div class="input-unit">
                                <span class="key-txt">
                                    用户名:
                                </span>
                    <input class="val-input" id="username"/>
                </div>
            </div>
            <button id="search-btn" type="button" class="am-btn am-btn-success am-btn-xs"
                    style="float:left;">
                搜索
            </button>
        </div>
        <table class="am-table am-table-striped am-table-hover am-table-centered admin-comm-tbl "
               style="">
            <thead>
            <tr>

                <th>公司全称</th>
                <th>用户名</th>
                <th>账户总金额</th>
                <th>可用余额</th>
                <th>结算保护金额</th>

                <th>收入冻结金额</th>
                <th>银行名称</th>
                <th>银行号</th>
                <th>银行账号</th>
                <th>账户名称</th>

                <th>操作</th>

            </tr>
            </thead>
            <tbody id="account-context" class="account-tbody">


            </tbody>
        </table>

        <div id="comm-paging" class="admin-paging" style="float:left;"></div>

    </div>

    <script type="text/template" id="tbl-list-templ">
        <% _.each(obj, function(item){   %>
        <tr>
            <td><span class="txt-line-2" style=""><%=item.company_name%></span></td>
            <td><span class="txt-line-2" style="" id="name">
								<%=item.user_name%>
							 </span></td>
            <td class="money"><span title="￥450123123000.00">
								<%=item.total%>
							 </span></td>
            <td class="money"><span title="￥450123123000.00">
								<%=item.may_money%>
							 </span></td>
            <td class="money"><span title="￥450123123000.00"><%=item.balance_money%></span></td>

            <td class="money"><span title="￥450123123000.00"><%=item.close_money%></span></td>
            <td><span class="txt-line-2" style=""><%=item.bank_name%></span></td>
            <td><span class="txt-line-2" style=""><%=item.bank_num%></span></td>
            <td><span class="txt-line-2" style=""><%=item.car_num%></span></td>
            <td><span class="txt-line-2" style=""><%=item.account_name%></span></td>

            <td>
                <button type="button"
                        class="sel-edit-btn am-btn am-btn-primary am-btn-xs "
                        style="float:left;" bank_name="<%=item.bank_name%>" user_name="<%=item.user_name%>"
                        bank_num="<%=item.bank_num%>" car_num="<%=item.car_num%>" account_name="<%=item.account_name%>">
                    编辑
                </button>
                <input type="text" class="editor-btn" style="display:none">
            </td>

        </tr>

        <% }); %>
    </script>

    <script type="text/template" id="tbl-list-templ">

</script>

    <script type="text/template" id="edit-dialog-templ">
        <div class="account-edit-dialog" style="">
            <form method="post" action="{{route('admin.account.index')}}" id="user_admin">
               <input type="hidden" value="{{csrf_token()}}" name="_token">
                <div class="input-line">
                    <span class="left-key">用户名：</span>
                    <span class="right-txt right-input" id="user_name"></span>
                </div>

                <div class="input-line">
                    <span class="left-key">银行名称：</span>
                    <input class="right-input" name="bank_name" id="bank_name"/>
                </div>

                <div class="input-line">
                    <span class="left-key">银行行号：</span>
                    <input class="right-input" name="bank_id" id="bank_num"/>
                </div>

                <div class="input-line">
                    <span class="left-key">银行账号：</span>
                    <span class="right-txt right-input" name="bank_account" id="car_num"></span>
                </div>

                <div class="input-line">
                    <span class="left-key">账户名称：</span>
                    <input class="right-input" name="account_name" id="account_name"/>
                </div>

                <div class="btns-line">
                    <button type="button"
                            class="sel-edit-btn am-btn am-btn-primary am-btn-sm"
                            style="float:left;" id="update-btn">
                        <div style="width:56px;">确认修改</div>
                    </button>
                    <button type="button"
                            class="sel-canel-btn am-btn am-btn-default am-btn-sm"
                            style="float:left; margin-left:35px;" id="cancel-btn">
                        <div style="width:56px;">取消</div>
                    </button>

                </div>

            </form>
        </div>
    </script>

    <script src="/assets/b2b/admin/js/libs/jquery.validate.min.js">
    </script>
    <script src="/assets/b2b/admin/js/libs/messages_zh.js">
    </script>
    <script src="/assets/b2b/admin/js/pages/02.js">
    </script>

@stop